/* Swaps the values of two indicies (mutates) */
Array.prototype.swap = function(index1, index2) {
    var temp = this[index1];
    this[index1] = this[index2];
    this[index2] = temp;
};

/* Randomly shuffles array (mutates)
* Dependencies: Array.swap() */
Array.prototype.shuffle = function() {
    for (var i = 0; i < this.length; ++i) {
        var ind1 = Math.floor(Math.random() * this.length);
        var ind2 = Math.floor(Math.random() * this.length);
        this.swap(ind1, ind2);
    }
};
